<template>
  <el-table tooltip-effect="dark" style="width: 100%" :data="data" ref="table">
    <el-table-column
      type="selection"
      width="100"
      @selection-change="handleSelectionChange"
    ></el-table-column>
    <el-table-column label="商品" width="800" prop="name"> </el-table-column>
    <el-table-column prop="price" label="价格" width="100"></el-table-column>
    <el-table-column prop="" label="数量" width="100">1</el-table-column>
    <el-table-column label="小计" width="100">200</el-table-column>
    <el-table-column label="操作" width="100"
      ><el-button>删除</el-button></el-table-column
    >
  </el-table>
  <el-button @click="goreate()" class="btn">结算</el-button>
</template>
<script>
import { reactive } from "@vue/reactivity";
import router from '@/router'
export default {
  name: "shop",
  props: ["data"],
  setup() {
    let product = reactive({
      name: "",
      price: "",
    });

    return {
      product,
    };
  },
  data() {
    return {
      multipleSelection : [],
    };
  },
  methods: {
    handleSelectionChange(val) {
      this.multipleSelection  = val;
    },
    goreate(){
      router.push('/createorder')
    }
  },
};
</script>
<style scoped>
.btn{
  margin-top: 20px;
  margin-right: 30px;
  float: right;
}
</style>